/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("tb_project_declaremessage",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using MYData.Entity.DomainModels;
using MYData.System.IServices;
using MYData.Core.Utilities;
 
using Microsoft.AspNetCore.Authorization;
using MYData.Entity.DomainModels.ApiEntity.Dto;

namespace MYData.System.Controllers
{
    public partial class tb_project_declaremessageController
    {
        private readonly Itb_project_declaremessageService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
         
        public tb_project_declaremessageController(
            Itb_project_declaremessageService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        /// <summary>
        /// 申报列表
        /// </summary>
        /// <param name = "informName" ></ param >
        /// < returns ></ returns >
        [HttpGet, Route("GetDeclaremessageList"),AllowAnonymous]
        public IActionResult   GetDeclareMessageList(string informName, string creator)
        {
            return Json(Service.GetDeclareMessageList( informName,creator));
        }
      
        /// <summary>
        /// 申报通知详情
        /// </summary>
        /// <param name = "informName" ></ param >
        /// < returns ></ returns >
        [HttpGet, Route("GetDeclareMessageDetail"), AllowAnonymous]
        public async Task<IActionResult> GetDeclareMessageDetail(string id )
        {
            return Json(await Service.GetDeclareMessageDetail(id));
        }

        /// <summary>
        /// 申报通知删除
        /// </summary>
        /// <param name = "informName" ></ param >
        /// < returns ></ returns >
        [HttpPost, Route("DeleteDeclareMessage"), AllowAnonymous]
        public IActionResult DeleteDeclareMessage(string id)
        {
            return Json( Service.DeleteDeclareMessage(id));
        }
        /// <summary>
        /// 申报通知添加
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("DeclareMessageAdd"), AllowAnonymous]
        public IActionResult GetInsertReviewstandar_item([FromBody]sys_dictionarylist_declare_appedixDto inputdto)
        {
            return Json(Service.GetInsertReviewstandar_item(inputdto));
        }

        /// <summary>
        /// 申报通知编辑
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("DeclareMessageUpdate"), AllowAnonymous]
        public IActionResult UpdateInsertReviewstandar_item([FromBody]Updatedeclare_appedixDto outimput)
        {
            return Json( Service.UpdateInsertReviewstandar_item(outimput));
        }
        /// <summary>
        /// 判断申报通知名唯一
        /// </summary>
        /// <param name="DeclareMessageId"></param>
        /// <returns></returns>
        [HttpGet, Route("BaseInfoDeclareMassageinformName"), AllowAnonymous]
        public async Task<IActionResult> BaseInfoDeclareMassage(string informName)
        {
            return Json(await Service.BaseInfoDeclareMassage(informName));
        }


        /// <summary>
        /// 角色绑定
        /// </summary>
        /// <param name="RoleList"></param>
        /// <returns></returns>
        [HttpGet, Route("RoleList"), AllowAnonymous]
        public async Task<IActionResult> RoleList()
        {
            return Json(await Service.RoleList());
        }

        /// <summary>
        /// 部门绑定
        /// </summary>
        /// <param name="DepartmentList"></param>
        /// <returns></returns>
        [HttpGet, Route("DepartmentList"), AllowAnonymous]
        public async Task<IActionResult> DepartmentList()
        {
            return Json(await Service.DepartmentList());
        }

        /// <summary>
        /// 根据id查询数据
        /// </summary>
        /// <param name="specialistID"></param>
        /// <returns></returns>
        [HttpGet, Route("DeclaremessageID")]
        [Authorize]
        [AllowAnonymous]
        public async Task<IActionResult> DeclaremessageID(string Id)
        {
            return Json(await Service.DeclaremessageID(Id));
        }









       



    }
}
